package client

import (
	"gitee.com/wydcn/wm/protocol"
	"log"
	"net"
	"strconv"
	"time"
)

func Start() {
	conn, err := net.Dial("tcp", ":8888")
	if err != nil {
		log.Println("dial error:", err)
		return
	}

	for{

		var body =[]byte("test"+strconv.Itoa(int(time.Now().UnixNano())))
		testPack := protocol.Protocol{
			Header: protocol.Header{
				ContentLength: 20,
				Type: 0x00,
			},
			Body: body,
		}

		conn.Write(testPack.ToBytes())
	}
}
